<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <title>tango.core.sync.Mutex</title>
  <link href="./css/style.css" rel="stylesheet" type="text/css"/>
  <!-- <link href="./img/icon.png" rel="icon" type="image/png"/> -->
  <script type="text/javascript" src="./js/jquery.js"></script>
  <script type="text/javascript" src="./js/modules.js"></script>
  <script type="text/javascript" src="./js/quicksearch.js"></script>
  <script type="text/javascript" src="./js/navigation.js"></script>
  <!--<script type="text/javascript" src="./js/jquery.treeview.js"></script>-->
  <script type="text/javascript">
    var g_moduleFQN = "tango.core.sync.Mutex";
  </script>
  
</head>
<body>
<div id="content">
  <h1><a href="./htmlsrc/tango.core.sync.Mutex.html" class="symbol">tango.core.sync.Mutex</a></h1>
  
<div class="summary">The mutex module provides a primitive for maintaining mutually exclusive
 access.</div>
<p class="sec_header">License:</p>BSD style: see <a href="http://www.dsource.org/projects/tango/wiki/LibraryLicense">license.txt</a>
<p class="sec_header">Authors:</p>Sean Kelly
<dl>
<dt class="decl">class <a class="symbol _class" name="Mutex" href="./htmlsrc/tango.core.sync.Mutex.html#L36" kind="class" beg="36" end="203">Mutex</a> : Object.Monitor; <a title="Permalink to this symbol" href="#Mutex" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.core.sync.Mutex.html#L36">#</a></dt>
<dd class="ddef">
<div class="summary">This class represents a general purpose, recursive mutex.</div>
<dl>
<dt class="decl"><a class="symbol _ctor" name="Mutex.this" href="./htmlsrc/tango.core.sync.Mutex.html#L50" kind="ctor" beg="50" end="64">this</a><span class="params">()</span>; <a title="Permalink to this symbol" href="#Mutex.this" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.core.sync.Mutex.html#L50">#</a></dt>
<dd class="ddef">
<div class="summary">Initializes a mutex object.</div>
<p class="sec_header">Throws:</p>SyncException on error.</dd>
<dt class="decl">void <a class="symbol _function" name="Mutex.lock" href="./htmlsrc/tango.core.sync.Mutex.html#L94" kind="function" beg="94" end="106">lock</a><span class="params">()</span>; <a title="Permalink to this symbol" href="#Mutex.lock" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.core.sync.Mutex.html#L94">#</a></dt>
<dd class="ddef">
<div class="summary">If this lock is not already held by the caller, the lock is acquired,
 then the internal counter is incremented by one.</div>
<p class="sec_header">Throws:</p>SyncException on error.</dd>
<dt class="decl">void <a class="symbol _function" name="Mutex.unlock" href="./htmlsrc/tango.core.sync.Mutex.html#L116" kind="function" beg="116" end="128">unlock</a><span class="params">()</span>; <a title="Permalink to this symbol" href="#Mutex.unlock" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.core.sync.Mutex.html#L116">#</a></dt>
<dd class="ddef">
<div class="summary">Decrements the internal lock count by one.  If this brings the count to
 zero, the lock is released.</div>
<p class="sec_header">Throws:</p>SyncException on error.</dd>
<dt class="decl">bool <a class="symbol _function" name="Mutex.tryLock" href="./htmlsrc/tango.core.sync.Mutex.html#L142" kind="function" beg="142" end="152">tryLock</a><span class="params">()</span>; <a title="Permalink to this symbol" href="#Mutex.tryLock" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.core.sync.Mutex.html#L142">#</a></dt>
<dd class="ddef">
<div class="summary">If the lock is held by another caller, the method returns.  Otherwise,
 the lock is acquired if it is not already held, and then the internal
 counter is incremented by one.</div>
<p class="sec_header">Returns:</p>true if the lock was acquired and false if not.
<p class="sec_header">Throws:</p>SyncException on error.</dd></dl></dd></dl>
</div>
<div id="footer">
  <p>Copyright (C) 2005-2006 Sean Kelly.  All rights reserved.</p>
  <p>Page generated by <a href="http://code.google.com/p/dil">dil</a> on Fri Dec 26 04:04:06 2008. Rendered by <a href="http://code.google.com/p/dil/wiki/Kandil">kandil</a>.</p>
</div>
</body>
</html>